using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Easy.Authorization.Models.Mapping
{
    public class Aut_RolesMap : EntityTypeConfiguration<Aut_Roles>
    {
        public Aut_RolesMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.RoleName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.RoleDescription)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Aut_Roles");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.RoleName).HasColumnName("RoleName");
            this.Property(t => t.RoleDescription).HasColumnName("RoleDescription");
        }
    }
}
